CreateLink
TheCreateLink
method should create a link-source object for this part.
ODLinkSource CreateLink (in ODByteArray data);
data
- A byte array whose buffer contains the data of a link specification, created earlier by this part, that defines the content of the link source to be linked to.
- return value
- A reference to a new link-source object to be used to represent the data.
DISCUSSION
OpenDoc calls this method when the user decides to create a link when pasting in or dropping data that originated in this part. If a link already exists to the specified source content, this method should return the existing link-source object; otherwise, this method should create a new link-source object and copy the source content into it.The data in a link specification is private to the part writing it. The data is only returned to this part when the
CreateLink
method actually creates a link-source object. If your part creates a link-source object, your part must maintain information about what portion of its content has been linked so that it may update the link-source object when that content data changes.Before returning the link-source object, your part's
CreateLink
method should call the link-source object'sAcquire
method. When the caller has finished using the returned link-source object, it should call the link-source object'sRelease
method.OVERRIDING
When you subclassODPart
, you can override this method. Your override method must not call its inherited method; that is, your override method must implement this method's functionality completely.EXCEPTIONS
kODErrDoesNotLink
- This part does not support linking.
kODErrOutOfMemory
- There is not enough memory to allocate the link-source object.
SEE ALSO
TheODByteArray
type (page 877).
The ODLinkSource class (page 371).
TheODLinkSpec
class (page 390).
Table 2-1 on page 89 in OpenDoc Programmer's Guide.
"Link Specification" on page 317 in OpenDoc Programmer's Guide.
"Creating a Link at the Source" on page 382 in OpenDoc Programmer's Guide.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help